package com.heima.behavior.controller.v1;

import com.heima.behavior.service.IApLikeBehaviorService;
import com.heima.model.behavior.dtos.LikeBehaviorDTO;
import com.heima.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "文章点赞 API")
@RestController
@RequestMapping("api/v1/likes_behavior")
public class ApLikesBehaviorController {

    @Autowired
    private IApLikeBehaviorService apLikeBehaviorService;

    @ApiOperation(value = "处理点赞或取消点赞行为")
    @PostMapping
    public ResponseResult handleLike(@RequestBody LikeBehaviorDTO likeBehaviorDTO){
        return apLikeBehaviorService.handleLike(likeBehaviorDTO);
    }

}
